<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简易手风琴1</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul,li{
            list-style: none;
        }
        .box{
            width: 400px;
            height: 100px;
            background: #ccc;
            margin: 20px auto;
            overflow: hidden;
        }
        ul{
            /* 解决li放大瞬间最后一个被挤出ul的下一行 */
            width: 450px;
        }
        li{
            float: left;
            width: 48px;
            border-right: 2px solid blue;
            position: relative;
            overflow: hidden;
        }
        li .tit{
            width: 48px;
            height: 100px;
            background: red;
        }
        li .con{
            width: 200px;
            height: 100px;
            background: #58bc58;
            position: absolute;
            left: 48px;
            top: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <ul class="list">
            <li>
                <div class='tit'>标题区域</div>
                <div class="con">内容区域</div>
            </li>
            <li>
                <div class='tit'>标题区域</div>
                <div class="con">内容区域</div>
            </li>
            <li>
                <div class='tit'>标题区域</div>
                <div class="con">内容区域</div>
            </li>
            <li>
                <div class='tit'>标题区域</div>
                <div class="con">内容区域</div>
            </li>
        </ul>
    </div>

    <script src="./js/jquery.3.5.1.js"></script>
    <script>
        $(function(){
            $('.list li').on('mouseover',function(){
                // stop解决动画队列问题
                $(this)
                .stop(true)
                .animate({
                    width:248
                })
                .siblings('li')
                .stop(true)
                .animate({
                    width:48
                })
            })
        })
    </script>
</body>
</html>